package com.wechat.back.mapper;

import com.wechat.back.pojo.pic.Bg;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface BgMapper {

    List<Bg> list(String bgType);

    @Insert("insert into bg(bg_name, bg_url, bg_desc, bg_type, create_time, update_time) " +
            "values (#{bgName}, #{bgUrl}, #{bgDesc}, #{bgType},#{createTime}, #{updateTime})")
    void add(Bg bg);

    @Update("update bg set bg_name=#{bgName}, bg_url=#{bgUrl}, bg_desc=#{bgDesc}, bg_type=#{bgType}, update_time=#{updateTime} where bg_id=#{bgId}")
    void update(Bg bg);

    @Delete("delete from bg where bg_id=#{bgId}")
    void delete(Integer bgId);
}
